using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using DataObject.Model;
using DataObject.Database;

	public partial class RouteServiceMapper
	{
		#region ToEntity

		public static RouteService ToEntity(RouteService entity, RouteServiceDTO businessobject)
		{
			if (businessobject == null)
			{
				return null;
			}
			entity.DayOfRoute = businessobject.DayOfRoute;
			entity.HotelPickupAddress = businessobject.HotelPickupAddress;
			entity.Program = businessobject.Program;
			entity.ProviderID = businessobject.ProviderID;
			entity.RouteID = businessobject.RouteID;
			entity.RouteServiceID = businessobject.RouteServiceID;
			entity.ServiceID = businessobject.ServiceID;
			entity.ServiceType = businessobject.ServiceType;
			return entity;
		}

		#endregion

		#region ToBusinessObject

		public static RouteServiceDTO ToBusinessObject(RouteService entity)
		{
			if (entity == null)
			{
				return null;
			}
			return new RouteServiceDTO
			{
				DayOfRoute = entity.DayOfRoute,
				HotelPickupAddress = entity.HotelPickupAddress,
				Program = entity.Program,
				ProviderID = entity.ProviderID,
				RouteID = entity.RouteID,
				RouteServiceID = entity.RouteServiceID,
				ServiceID = entity.ServiceID,
				ServiceType = entity.ServiceType,
				Provider = ProviderMapper.ToBusinessObject(entity.ProviderEntity),
				Route = RouteMapper.ToBusinessObject(entity.Route),
				Service = ServiceMapper.ToBusinessObject(entity.Service)
			};
		}

		#endregion

		#region ToBusinessObjectHasChildren

		public static RouteServiceDTO ToBusinessObjectHasChildren(RouteService entity, params Type[] types)
		{
			if (entity == null)
			{
				return null;
			}
			RouteServiceDTO businessobject = new RouteServiceDTO
			{
				DayOfRoute = entity.DayOfRoute,
				HotelPickupAddress = entity.HotelPickupAddress,
				Program = entity.Program,
				ProviderID = entity.ProviderID,
				RouteID = entity.RouteID,
				RouteServiceID = entity.RouteServiceID,
				ServiceID = entity.ServiceID,
				ServiceType = entity.ServiceType,
				Provider = ProviderMapper.ToBusinessObject(entity.ProviderEntity),
				Route = RouteMapper.ToBusinessObject(entity.Route),
				Service = ServiceMapper.ToBusinessObject(entity.Service)
			};
			return businessobject;
		}

		#endregion

	}
